﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace NMLX_Data_Management
{
    public partial class ClearDb : Form
    {
        public ClearDb()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            ArrayList list = new ArrayList();
            list.Add("delete from DetailRecord;");
            list.Add("delete from Project;");
            list.Add("delete from ProjectDetail;");
            list.Add("delete from t_User;");
            if (textBox1.Text=="amtf")
            {
                try
                {
                    NMLX.DBUtility.DbHelperOleDb.ExecuteSqlTran(list);
                    MessageBox.Show("清空数据库成功");
                    this.Close();
                }
                catch (Exception ex)
                {

                    MessageBox.Show(ex.Message);
                }
            }
        }

        private void ClearDb_FormClosing(object sender, FormClosingEventArgs e)
        {
            this.DialogResult = DialogResult.OK;
        }
    }
}
